(function () {
    // swiper 插件轮播图使用 CC_Swiper

    var ccSwiper =  new Swiper(".CC_Swiper", {
        parallax : true,
        speed:1000,
        spaceBetween: 30,
        centeredSlides: true,
        autoplay: {
            delay: 2500,
            disableOnInteraction: false,
        },
        pagination: {
            el: ".swiper-pagination",
            bulletElement: 'div',
            clickable: true,
            bulletActiveClass: 'my-bullet-active',
            bulletClass: 'my-bullet',
        },
    });

    ccSwiper.el.onmouseover = function(){ //鼠标放上暂停轮播
        ccSwiper.autoplay.stop();
    }
    ccSwiper.el.onmouseleave = function(){
        ccSwiper.autoplay.start();
    }

    // tab栏切换
    var cc_items = document.querySelectorAll('.cc_tab>ul>li');
    var cc_ul_item = document.querySelectorAll('.cc_ul_item');

    for (var i = 0; i < cc_items.length; i++) {
        cc_items[i].setAttribute('index', i);
        cc_items[i].onmouseover = function () {
            for (var i = 0; i < cc_items.length; i++) {
                cc_items[i].classList = '';
            }
            this.classList = 'cc_items';
            // 内容显示板块
            var index = this.getAttribute('index');
            for (var i = 0; i < cc_ul_item.length; i++) {
                cc_ul_item[i].style.display = 'none';
            }
            cc_ul_item[index].style.display = 'block';
        }
    };


    // 官方/合作样式
    var cc_swich = document.querySelectorAll('.cc_switch>a');
    for (var i = 0; i < cc_swich.length; i++) {
        cc_swich[i].onmouseover = function () {
            for (var i = 0; i < cc_swich.length; i++) {
                cc_swich[i].classList = '';
            }
            this.classList = 'cc_one';
        }
    };


})()